export const getImageUrl = (fileName = '') => {
  return require(`../img/${fileName}.png`)
}

export const getFileIconUrl = (fileType = '') => {
  const typeMap = {
    EXCEL: 'icon_file_excel.png',
    MP3: 'icon_file_mp3.png',
    MP4: 'icon_file_mp4.png',
    PDF: 'icon_file_pdf.png',
    PPT: 'icon_file_ppt.png',
    TXT: 'icon_file_txt.png',
    WORD: 'icon_file_word.png',
  }

  const upperFileType = fileType.toUpperCase()
  const iconFileName = typeMap[upperFileType] || 'icon_file_other.png'

  try {
    return require(`../img/${iconFileName}`)
  } catch (error) {
    return require(`../img/icon_file_other.png`)
  }
}
